package com.qf.blog.commons.response;


import java.util.HashMap;

/**
 * 响应给前端的格式要统一
 */
public class ResponseResult extends HashMap {

    // 返回成功
    public static ResponseResult success() {
        ResponseResult r = new ResponseResult();
        r.put("code", 200); // 200成功
        return r;
    }

    // 成功有数据
    public static ResponseResult success(Object data) {
        ResponseResult success = success();
        success.put("data", data);
        return success;
    }
}
